import { queryOperateLogList } from "@/services/system/SystemController";
import { PageContainer, ProColumns, ProTable } from "@ant-design/pro-components";

const Page: React.FC = () => {
    const columns: ProColumns<System.OperateLogInfo>[] = [
        { title: 'Id', dataIndex: 'id' },
        {
            title: "操作状态", dataIndex: 'result', valueEnum: {
                0: { text: '成功', status: 'Success' },
                1: { text: '失败', status: 'Error' },
            }
        },
        { title: '路径', dataIndex: 'request_path', renderText: (text) => decodeURI(text) },
        { title: '参数', dataIndex: 'request_query' },
        { title: '方法', dataIndex: 'request_method' },
        { title: '数据', dataIndex: 'request_data', valueType: "jsonCode" },
        { title: '操作人', dataIndex: 'operator_name' },
        { title: '操作时间', dataIndex: 'created_at', valueType: "dateTime" },
    ]
    return <PageContainer breadcrumbRender={false}>
        <ProTable<System.OperateLogInfo> request={queryOperateLogList} search={false} rowKey="id" columns={columns} options={{ density: false, setting: false }}>
        </ProTable>
    </PageContainer>
}
export default Page;